<%--
 - Copyright (c) 2009-2011 ETCORE Labs. All rights reserved. 
 - 
 - This software is the confidential and proprietary information of ETCORE Labs. 
 - You shall not disclose such confidential information and shall use it only
 - in accordance with the terms of the license agreement you entered into
 - with ETCORE Labs.
 -
 - Support can be obtained from support forums at:
 - http://www.etcore.com/
 -
 - @author: ETCORE GroupTalk developers
 -
 --%>
<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib uri="http://jakarta.apache.org/taglibs/core" prefix="c"%>
<%@ taglib uri="http://www.etcore.com/grouptalk" prefix="grouptalk"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<link rel="stylesheet" href="/group/css/styles.css" type="text/css">


</head>

<body >

<div
	style="font-size: 12px;  font-weight: bold; color: #808080; border-bottom: 1px solid #d2d2d4"><c:out
	value="${context.latest_msgs  }" /></div>
 
<div id=latestList
	style="vertical-align: top; overflow: hidden; margin-top:10px;height: 350px;">
<div id=latestContent>
<table cellpadding=0 cellspacing=2  width=100%
	style="border: 0px solid #d4d2d4;  " align=center>

	<c:forEach var="currentMsg" items="${publicMsgs}">
		<c:set var="platfromLabel"
			value='platform${groupMap[currentMsg[0]].open}' />
		<c:if
			test="${groupMap[currentMsg[0]].nav==1&&groupMap[currentMsg[0]].open==1}">
			<c:set var="platfromLabel" value='nav1' />
		</c:if>
		<c:if
			test="${groupMap[currentMsg[0]].nav==1&&groupMap[currentMsg[0]].open==2}">
			<c:set var="platfromLabel" value='nav2' />
		</c:if>
		<c:set var="encryptedUrl"
			value='encryptedUrl${groupMap[currentMsg[0]].open}' />
		<c:if test="${groupMap[currentMsg[0]].open==1}">
			<c:set var="viewer" value="newsView" />
			<c:set var="platform" value="news" />
		</c:if>
		<c:if test="${groupMap[currentMsg[0]].open==2}">
			<c:set var="viewer" value="communityView" />
			<c:set var="platform" value="community" />
		</c:if>
		<c:if test="${groupMap[currentMsg[0]].open==3}">
			<c:set var="viewer" value="bookmarksView" />
			<c:set var="platform" value="bookmarks" />
		</c:if>
		<c:if test="${groupMap[currentMsg[0]].open==4}">
			<c:set var="platform" value="reminders" />
		</c:if>
		<c:set var="toUserAvatar" value="${currentMsg[4]}_avatar" />
		<c:url value="viewUser${context.postfix}" var="toUserUrl">
			<c:param name="targetUserName" value="${currentMsg[4]}" />
		</c:url>
		<tr>

			<td  style="border-bottom: 1px dashed #d2d4d2">
			<table cellpadding=2 cellspacing=2 width=100% align=center>
				<tr>
					<td width=50 nowrap><a style="font-size: 12px; color: #005EAC"
						href="/group/${toUserUrl }"><c:if
						test="${not empty requestScope[toUserAvatar] &&fn:indexOf(requestScope[toUserAvatar],'upload')!=-1 }">
						<img src="${requestScope[toUserAvatar]}" width=48 height=48
							border=0 />
					</c:if><c:if
						test="${empty requestScope[toUserAvatar]||fn:indexOf(requestScope[toUserAvatar],'upload')==-1 }">
						<img src="/group/images/avatar/avatar.jpg" width=48 height=48
							border=0 />
					</c:if></a></td>
					<td style="font-size: 12px; color: #808080;" valign=top align=left><a
						style="font-size: 12px; color: #005EAC"
						href="/group/${toUserUrl }">${currentMsg[4]}</a> ${currentMsg[3]}<br />

					<a style="font-size: 12px; color: #404040"
						href="/group/${platform}${context.postfix }?nav=${groupMap[currentMsg[0]].nav}">[<c:out
						value='${context[platfromLabel] }' />]</a><c:if
						test="${groupMap[currentMsg[0]].open!=4 }">
						<c:if test="${!context[encryptedUrl]}">
							<a style="font-size: 12px; color: #404040"
								href="/group/<c:out value='${viewer }'/>${context.postfix }?gid=<c:out value='${groupMap[currentMsg[0]].id }'/>&tid=<c:out value='${currentMsg[1]}'/>"><c:out
								value='${groupMap[currentMsg[0]].name}' /></a>
						</c:if>
						<c:if test="${context[encryptedUrl]}">

							<c:set var='urlFragmentStr'
								value='?gid=${groupMap[currentMsg[0]].id}&tid=${ currentMsg[1]}' />
							<c:set var='urlFragment'
								value='${grouptalk:getEncryptedStr(urlFragmentStr)}' />
							<a <c:if test="${not empty param.target}"> target=_top </c:if>
								style="font-size: 12px; color: #404040"
								href="/group/<c:out value='${viewer }'/>${context.postfix }/~<c:out value='${urlFragment}'/>">
							<c:out value='${groupMap[currentMsg[0]].name}' /></a>
						</c:if>
					</c:if> ~ <c:if test="${!(context.msg_encryptedUrl)}">

						<a style="font-size: 12px; color: #404040"
							href="/group/messagedetail${context.postfix }?id=<c:out value='${currentMsg[0] }'/>"
							target=_blank> <c:if
							test="${groupMap[currentMsg[0]].open==4 }">
							<c:set var='reminderDate' value='${currentMsg[0] }reminderDate' />
							<c:out value='${requestScope[reminderDate] }' />
						</c:if> <c:if test="${currentMsg[7] >0 }">
							<font color=red>
						</c:if><c:out value='${currentMsg[2] }' /><c:if
							test="${currentMsg[7] >0 }">
							</font>
						</c:if> </a>
					</c:if> <c:if test="${context.msg_encryptedUrl}">
						<c:set var='urlFragmentStr' value='?id=${currentMsg[0]}' />
						<c:set var='urlFragment'
							value='${grouptalk:getEncryptedStr(urlFragmentStr)}' />
						<a <c:if test="${not empty param.target}"> target=_top </c:if>
							style="font-size: 12px; color: #404040"
							href="/group/messagedetail${context.postfix }/~<c:out value='${urlFragment}'/>">
						<c:if test="${groupMap[currentMsg[0]].open==4 }">
							<c:set var='reminderDate' value='${currentMsg[0] }reminderDate' />
							<c:out value='${requestScope[reminderDate] }' />
						</c:if> <c:if test="${currentMsg[7] >0 }">
							<font color=red>
						</c:if><c:out value='${currentMsg[2] }' /><c:if
							test="${currentMsg[7] >0 }">
							</font>
						</c:if> </a>
					</c:if></td>

				</tr>
			</table>
		 </td></tr>
		<c:set var="rowCount" value="${rowCount+1 }" />
	</c:forEach>
</table>
</div>
<div id=latestContent2></div>
&nbsp;
</div>
<script language="javascript"> 
var speed=40;
latestContent2.innerHTML=latestContent.innerHTML 
function latestMarquee(){ 
if(latestContent2.offsetTop-latestList.scrollTop<=0) 
latestList.scrollTop-=latestContent.offsetHeight 
else{ 
latestList.scrollTop++ 
} 
} 
var latestMar=setInterval(latestMarquee,speed); 
latestList.onmouseover=function() {clearInterval(latestMar);} 
latestList.onmouseout=function() {latestMar=setInterval(latestMarquee,speed)} 
</script>&nbsp;
</body>
</html>

